home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / SMAK124.ARJ / SMAK_ASM.DOC < prev    next >
Text File  |  1992-04-09  |  2KB  |  68 lines

  1.  
  2.                     Using SMAK with ASM source files
  3.  
  4.  
  5.  
  6. SMAK works with ASM, too!  If the main source module is named with the
  7. usual file extension (.ASM or .asm), SMAK will look for directives
  8. commented off with a semicolon, rather than the default apostrophe.
  9.  
  10. Note:  My knowledge of assemblers is limited to Microsoft's MASM 5.0 and
  11. Borland's TASM 2.0, which are the only assemblers I have tested SMAK
  12. with.  I would appreciate any information that others can provide me with
  13. concerning other assemblers that may use a different syntax.
  14.  
  15.  
  16.  
  17. Entering "SMAK hello.asm" command at the DOS prompt will "make" the
  18. following sample program using MASM.  If you use TASM, enter "SMAK
  19. hello.asm /2".
  20.  
  21.  
  22.  
  23. ;==================== Begin program HELLO.ASM ===================
  24.  
  25. ; Note that SMAK directives are commented off with a semicolon.
  26.  
  27.  
  28. ;begin MAKE
  29. ;  c:\util\masm\masm             ; your assembler program file spec
  30. ;  c:\util\masm\link             ; your linker program file spec and options
  31. ;  begin ASM                     ; source file default extension - source list follows
  32. ;    c:\masm\samples\hello /w2/z ; main source module with assembler options
  33. ;end MAKE
  34.  
  35.  
  36. Data_Seg   Segment Word Public 'Data'
  37.  
  38. Msg        DB   "  HELLO!  (compiled and linked with SMAK, written in MASM 5.0)",13,10
  39. MsgLen     EQU  $ - Msg
  40.  
  41. Data_Seg   Ends
  42.  
  43.  
  44.  
  45.  
  46. Code_Seg   Segment Word Public 'Code'
  47.            Assume   CS:Code_Seg, DS:Data_Seg
  48.  
  49. Begin:
  50.            Mov  AX,Data_Seg            ; copy Data_Seg address into AX
  51.            Mov  DS,AX                  ;   and set DS to that address
  52.  
  53.            Mov  BX,1                   ; 1 = file handle for standard output
  54.            Mov  CX,MsgLen              ; CX holds length of message to display
  55.            Mov  DX,offset Msg          ; DS:DX points to first chr in message
  56.            Mov  AH,40h                 ; DOS Write function number
  57.            Int  21h                    ; call DOS
  58.  
  59.            Mov  AX,4C00h               ; DOS Exit function number with errlevel 0
  60.            Int  21h                    ; call DOS
  61.  
  62.            
  63. Code_Seg   Ends
  64. End        Begin
  65.  
  66. ;===================== End program HELLO.ASM ====================
  67.  
  68.